package com.education.cms.dao;

import com.education.cms.domain.Clock;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;

public interface ClockDao extends JpaRepository<Clock,Integer> {
    @Query("select clock from Clock clock where clock.userId=:userId and clock.clockStatus=0")
    Clock getClock(Integer userId);

    Page<Clock> findAllByUserId(Integer userId,Pageable pageable);

    Page<Clock> findAll(Specification<Clock> specification,Pageable pageable);

}
